home *** CD-ROM | disk | FTP | other *** search
/ Mega Game 2000 #3 / Mega Game № 03 2000.iso / Data / Mainmenu.dxr / Script_19_scr_news.ls < prev    next >
Encoding:
Text File  |  2000-02-15  |  2.6 KB  |  94 lines

  1. global numNews, curNews, wx1, wx2, strY, SSpr, uSpeed, bSetNews, rectNews, WCurrentNews, arrStr, curX
  2.  
  3. on NewsInit
  4.   rectNews = rect(0, 0, 0, 0)
  5.   WCurrentNews = 0
  6.   bSetNews = 0
  7.   numNews = 27
  8.   if curNews < numNews then
  9.     curNews = curNews + 1
  10.   else
  11.     curNews = 1
  12.   end if
  13.   wx1 = 50
  14.   wx2 = 700
  15.   strY = 486
  16.   SSpr = 30
  17.   uSpeed = 2
  18.   arrStr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  19.   curX = 0
  20. end
  21.  
  22. on NewsRedraw
  23.   if (curNews = 0) or (bSetNews = 0) then
  24.     bSetNews = 1
  25.     set the member of sprite SSpr to "N" & curNews
  26.     set the locH of sprite SSpr to wx2
  27.     set the locV of sprite SSpr to strY
  28.     rectNews = member("N" & curNews).rect
  29.     WCurrentNews = rectNews.right - rectNews.left
  30.   else
  31.     if uSpeed > 0 then
  32.       if (the locH of sprite SSpr + WCurrentNews) > wx1 then
  33.         set the locH of sprite SSpr to the locH of sprite SSpr - uSpeed
  34.       else
  35.         if curNews < numNews then
  36.           curNews = curNews + 1
  37.           set the member of sprite SSpr to "N" & curNews
  38.         else
  39.           curNews = 1
  40.           set the member of sprite SSpr to "N" & curNews
  41.         end if
  42.         rectNews = member("N" & curNews).rect
  43.         WCurrentNews = rectNews.right - rectNews.left
  44.         set the locH of sprite SSpr to wx2
  45.       end if
  46.     else
  47.       if the locH of sprite SSpr < wx2 then
  48.         set the locH of sprite SSpr to the locH of sprite SSpr - uSpeed
  49.       else
  50.         if curNews > 1 then
  51.           curNews = curNews - 1
  52.           set the member of sprite SSpr to "N" & curNews
  53.         else
  54.           curNews = numNews
  55.           set the member of sprite SSpr to "N" & curNews
  56.         end if
  57.         rectNews = member("N" & curNews).rect
  58.         WCurrentNews = rectNews.right - rectNews.left
  59.         set the locH of sprite SSpr to wx1 - WCurrentNews
  60.       end if
  61.     end if
  62.   end if
  63. end
  64.  
  65. on NewsSpeed uSpeedA
  66.   uSpeed = uSpeedA
  67. end
  68.  
  69. on NewsNext
  70.   if curNews < numNews then
  71.     curNews = curNews + 1
  72.     set the member of sprite SSpr to "N" & curNews
  73.   else
  74.     curNews = 1
  75.     set the member of sprite SSpr to "N" & curNews
  76.   end if
  77.   rectNews = member("N" & curNews).rect
  78.   WCurrentNews = rectNews.right - rectNews.left
  79.   set the locH of sprite SSpr to wx2
  80. end
  81.  
  82. on NewsPrev
  83.   if curNews > 1 then
  84.     curNews = curNews - 1
  85.     set the member of sprite SSpr to "N" & curNews
  86.   else
  87.     curNews = numNews
  88.     set the member of sprite SSpr to "N" & curNews
  89.   end if
  90.   rectNews = member("N" & curNews).rect
  91.   WCurrentNews = rectNews.right - rectNews.left
  92.   set the locH of sprite SSpr to wx2
  93. end
  94.